package com.gaoxiang.demo;

import com.gaoxiang.demo.util.EsUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * Hello world!
 *
 */
@SpringBootApplication
public class App implements ApplicationRunner
{
    public static void main( String[] args ){
        SpringApplication.run(App.class, args);
    }
    @Autowired
    EsUtil esUtil;
    @Override
    public void run(ApplicationArguments args) throws Exception {
//        for(int i=0;i<50;i++){
//            esUtil.testInsert("abc","blog",String.valueOf(i));
//        }
//        System.out.println("插入成功");
        System.out.println(esUtil.queryAll().size());
    }
}
